<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <f:view contentType="text/html">
        <h:outputStylesheet library="css" name="default.css"/>
        <h:head>
            <title>Mantenimiento Carreras</title>
        </h:head>
        <h:body >
            <h:form id="formCar">
            <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
                <h:panelGrid columns="4" columnClasses="alinder,alinizq,alinder,alinizq" id="grid"  >
                    <p:outputLabel value="Referencia" for="car000" styleClass="requiredLbl"/>
                    <p:inputText value="#{ctrCarreras.activeReg.ccodigo}" label="Referencia" id="car000" size="10" required="true" >
                        <f:validateLength maximum="10" />
                    </p:inputText>
                    <h:panelGroup/><h:panelGroup/>
                    <p:outputLabel value="Carrera" for="car001" styleClass="requiredLbl"/>
                    <p:inputText value="#{ctrCarreras.activeReg.cnombre}" label="Nombre" id="car001" size="30" required="true" >
                        <f:validateLength maximum="30" />
                    </p:inputText>

                    <p:outputLabel value="Campus" for="car002" styleClass="optionalLbl" />
                    <p:inputText value="#{ctrCarreras.activeReg.ccampus}"  label="Campus" id="car002" size="30">
                        <f:validateLength maximum="30" />
                    </p:inputText>
                  
                   <h:panelGroup/><h:panelGroup/><h:panelGroup/><h:panelGroup/>
                    
                    <p:outputLabel value="Coordinador" for="car003" styleClass="optionalLbl" />
                    <p:inputText value="#{ctrCarreras.activeReg.ccoordinador}"  label="coordinador" id="car003" size="30">
                        <f:validateLength maximum="40" />
                    </p:inputText>
                    
                    <p:outputLabel value="Despacho" for="car004" styleClass="optionalLbl" />
                    <p:inputText value="#{ctrCarreras.activeReg.cdespacho}"  label="despacho" id="car004" size="10">
                        <f:validateLength maximum="10" />
                    </p:inputText>
                    
                    <p:outputLabel value="E-Mail" for="car005" styleClass="optionalLbl" />
                    <p:inputText value="#{ctrCarreras.activeReg.cmail}"  label="mail" id="car005" size="40">
                        <f:validateLength maximum="40" /> 
                        <f:validator validatorId="emailValidator" />
                        
                    </p:inputText>
                    
                    <p:outputLabel value="Teléfono" for="car006" styleClass="optionalLbl" />
                    <p:inputText value="#{ctrCarreras.activeReg.ctelefono}"  label="teléfono" id="car006" size="10">
                        <f:validateLength maximum="10" />
                    </p:inputText>

                    <h:panelGroup/><h:panelGroup/><h:panelGroup/><h:panelGroup/>
                    <h:panelGroup/><h:panelGroup/><h:panelGroup/><h:panelGroup/>
                    <h:panelGroup/><h:panelGroup/><h:panelGroup/><h:panelGroup/>
                    <h:panelGroup/><h:panelGroup/><h:panelGroup/><h:panelGroup/>
                    <h:panelGroup/><h:panelGroup/><h:panelGroup/><h:panelGroup/>
                    <p:commandButton value="Save"  id="saveCar" actionListener="#{ctrCarreras.save}" />
                    <p:commandButton actionListener="#{ctrCarreras.delete}" value="Delete" id="deleteCar" rendered="#{not ctrCarreras.lnuevo}" >
                        <p:confirm header="Confirmación" message="¿Esta seguro que quiere borrar esta carrera?" icon="ui-icon-alert" />
                    </p:commandButton>

                    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
                        <p:commandButton value="Si" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                        <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
                    </p:confirmDialog>
                </h:panelGrid>
            </h:form>
        </h:body>
    </f:view>
</html>

